package com.example.yc_plugin_learn;

import android.content.Context;

import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.MessageCodec;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.platform.PlatformView;
import io.flutter.plugin.platform.PlatformViewFactory;

/**
 PlatformViewFactory用于创建PlatformView
 */

public class YcPlatformViewFactory extends PlatformViewFactory {

    private FlutterPlugin.FlutterPluginBinding flutterPluginBinding;
    public YcPlatformView platformView;

    public YcPlatformViewFactory(MessageCodec<Object> createArgsCodec, FlutterPlugin.FlutterPluginBinding binding) {
        super(createArgsCodec);
        flutterPluginBinding = binding;
    }

    @Override
    public PlatformView create(Context context, int i, Object o) {
        platformView = new YcPlatformView(context,i,o,flutterPluginBinding);
        return platformView;
    }
}
